home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ODObject.cp
-
- Contains: Definition of class ODObject
-
- Owned by: Vincent Lo
-
- Copyright: © 1993 - 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 6/6/96 jpa T10020: Added fn prefix to metaclass to
- avoid CW compiler warnings.
- <12> 8/26/95 TÇ 1273191 Lets eliminate
- ODObject::IsInitialized
- <11> 5/26/95 RR #1251403: Multithreading naming support
- <10> 5/4/95 eeh 1243497: make ReleaseExtension raise
- exception
- <9> 4/26/95 CG 1211082 BB: 5$ Bugs need to be evaluated
- and removed from Core
- <8> 9/14/94 jpa ODValidatePtr --> MMValidatePtr [1186692]
- <7> 8/31/94 TÇ #1183129, #1183116, #1183119, #1183111:
- Lots of ErrorCode cleanup.
- <6> 8/17/94 jpa Tore out THROW on SubClassResponsibility:
- we cannot throw out of SOM methods!!!
- <5> 8/17/94 jpa Warn when deleting problematic object
- (block not marked as SOM object) [1181510]
- <4> 8/12/94 VL Added IsEqualTo.
- <3> 7/21/94 VL SubClassResponsibility should THROW instead
- of WARN.
- <2> 7/8/94 VL Added warn to SubClassResponsibility.
- <1> 6/22/94 CG first checked in
- <0> 6/21/94 SV SOMverted
- <9> 5/27/94 MB #1162181: Fixed MMM integration bug
- <8> 5/9/94 MB #1162181: Changes necessary to install MMM.
- <7> 3/25/94 MB Symantec ASLM fixes. #1150864
- <6> 3/15/94 MB Changes to support SCpp/ASLM builds,
- #1150864.
- <5> 2/25/94 TÇ comment/ifdef the validate object stuff
- <4> 2/22/94 CC Moved GetFirstObject here for ASLM.
- <3> 2/22/94 VL Added include for ODMemory.
- <2> 2/22/94 VL Added support for object list.
- <11> 2/8/94 TÇ Throw -> THROW & some code clean up
- <10> 1/11/94 TÇ Init... changes
- <9> 12/15/93 TÇ InitObject changes
- <8> 12/3/93 TÇ Stop including ODError.h, it is included
- as ErrorDef.h inside Except.h
- <7> 11/11/93 TÇ Throw(kODErrUnsupportedExtension) in
- GetExtension
- <6> 8/9/93 PH Segmentation
- <5> 6/16/93 VL Moved ODRefCntObject and
- ODPersistentObject to their own files.
- <4> 6/10/93 NP Changed some parameter types to ODType.
- <3> 5/6/93 NP Added Initialize method.
- <2> 4/29/93 TÇ change names of includefiles
- <1> 4/26/93 RCR first checked in
-
- To Do:
- */
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
-
- #define ODObject_Class_Source
- #define VARIABLE_MACROS
- #include <ODObject.xih>
-
- #ifndef _EXCEPT_
- #include "Except.h"
- #endif
-
- #ifndef _ODMEMORY_
- #include <ODMemory.h>
- #endif
-
-
- #pragma segment ODObject
-
-
- #if ODDebug
-
- #ifndef _ODMEMORY_
- #include <ODMemory.h>
- #endif
-
- #ifndef _MEMDEBG_
- #include <MemDebg.h>
- #endif
-
- SOM_Scope ODObject* SOMLINK ODObject_fFirst = kODNULL;
-
- #endif
-
- SOM_Scope void SOMLINK ODObjectInitObject(ODObject *somSelf, Environment *ev)
- {
- //ODObjectData *somThis = ODObjectGetData(somSelf);
- ODObjectMethodDebug("ODObject","InitObject");
- }
-
-
- SOM_Scope ODBoolean SOMLINK ODObjectHasExtension(ODObject *somSelf, Environment *ev,
- ODType extensionName)
- {
- // ODObjectData *somThis = ODObjectGetData(somSelf);
- ODObjectMethodDebug("ODObject","HasExtension");
-
- ODUnused(extensionName);
- return kODFalse;
- }
-
-
- SOM_Scope ODExtension* SOMLINK ODObjectAcquireExtension(ODObject *somSelf, Environment *ev,
- ODType extensionName)
- {
- // ODObjectData *somThis = ODObjectGetData(somSelf);
- ODObjectMethodDebug("ODObject","AcquireExtension");
-
- ODUnused(extensionName);
- ODSetSOMException(ev,kODErrUnsupportedExtension);
- return kODNULL;
- }
-
- SOM_Scope void SOMLINK ODObjectReleaseExtension(ODObject *somSelf, Environment *ev,
- ODExtension* extension)
- {
- // ODObjectData *somThis = ODObjectGetData(somSelf);
- ODObjectMethodDebug("ODObject","ReleaseExtension");
-
- ODUnused(extension);
- ODSetSOMException(ev, kODErrUnsupportedExtension );
- }
-
- SOM_Scope ODSize SOMLINK ODObjectPurge(ODObject *somSelf, Environment *ev,
- ODSize size)
- {
- // ODObjectData *somThis = ODObjectGetData(somSelf);
- ODObjectMethodDebug("ODObject","Purge");
-
- return 0;
- }
-
- SOM_Scope ODBoolean SOMLINK ODObjectIsEqualTo(ODObject *somSelf, Environment *ev,
- ODObject* object)
- {
- // ODObjectData *somThis = ODObjectGetData(somSelf);
- ODObjectMethodDebug("ODObject","IsEqualTo");
-
- return (somSelf == object ? kODTrue : kODFalse);
- }
-
- SOM_Scope void SOMLINK ODObjectSubClassResponsibility(ODObject *somSelf, Environment *ev)
- {
- // ODObjectData *somThis = ODObjectGetData(somSelf);
- ODObjectMethodDebug("ODObject","SubClassResponsibility");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
- }
-
- SOM_Scope void SOMLINK ODObjectsomInit(ODObject *somSelf)
- {
- ODObjectMethodDebug("ODObject","somInit");
-
- ODObject_parent_SOMObject_somInit(somSelf);
-
- ODBlockIsObject(somSelf,kODTrue); // Inform memory mgr this is an object
- }
-
- SOM_Scope void SOMLINK ODObjectsomUninit(ODObject *somSelf)
- {
- ODObjectMethodDebug("ODObject","somUninit");
-
- #if ODDebug
- if( !ODIsBlockAnObject(somSelf) ) {
- // It's not marked in the heap as a SOM object. What's wrong?
- if( !MMValidatePtr(somSelf,kODTrue,"somUninit") )
- return;
- else if( !somIsObj(somSelf) ) {
- WARN("somUninit called on non-SOM-object %p",somSelf);
- return;
- } else
- WARN("Block %p mistakenly not marked as SOM object",somSelf);
- }
- #endif
-
- ODBlockIsObject(somSelf,kODFalse); // This is no longer an object
-
- ODObject_parent_SOMObject_somUninit(somSelf);
- }
-
- SOM_Scope SOMObject* SOMLINK M_ODObjectsomNew(M_ODObject *somSelf)
- {
- // 1242632 Why do we need this method? It doesn't do anything but call its parent!
-
- /* M_ODObjectData *somThis = M_ODObjectGetData(somSelf); */
- M_ODObjectMethodDebug("M_ODObject","somNew");
-
- return (M_ODObject_parent_SOMClass_somNew(somSelf));
- }
-